import { ipcMain } from "electron";
import { clientDocService } from "~/service";

ipcMain.handle("/api/client/doc/insert", async (_e, payload) => {
  const { id, index, data } = payload;
  return clientDocService.insertDoc(id, index, data);
});

ipcMain.handle("/api/client/doc/update", async (_e, payload) => {
  const { id, index, docId, data } = payload;
  return clientDocService.updateDoc(id, index, docId, data);
});

ipcMain.handle("/api/client/doc/deleteBatch", async (_e, payload) => {
  const { id, index, docIds } = payload;
  return clientDocService.deleteBatchDoc(id, index, docIds);
});
